﻿@model ShivamEMR.Model.Domain.CompanyDomain.Employee

@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h1>Create New Employee</h1>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>


@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
<div class='metro-pivot'>
<div class='pivot-item'>
     <h3>Personal Details</h3> 

        <table width="100%" cellpadding="4" cellspacing="4">

          <tr>
	<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.Code)
        </div>
</td>
<td>

        <div class="editor-field">
            @Html.EditorFor(model => model.Code)
            @Html.ValidationMessageFor(model => model.Code)
        </div>
</td>
<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
</td>
<td>

        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>
</td>
    </tr>

           <tr>
<td>
        <div class="editor-label">
            @Html.LabelFor(model => model.FirstName)
        </div>
</td>
<td>

        <div class="editor-field">
            @Html.EditorFor(model => model.FirstName)
            @Html.ValidationMessageFor(model => model.FirstName)
        </div>
</td>
<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.MiddleName)
        </div>
</td>
<td>

        <div class="editor-field">
            @Html.EditorFor(model => model.MiddleName)
            @Html.ValidationMessageFor(model => model.MiddleName)
        </div>
</td>
    </tr>

	   <tr>
   <td>

        <div class="editor-label">
            @Html.LabelFor(model => model.LastName)
        </div>
</td>
<td>

        <div class="editor-field">
            @Html.EditorFor(model => model.LastName)
            @Html.ValidationMessageFor(model => model.LastName)
        </div>
</td>
<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.AltFirstName)
        </div>
</td>
<td>

        <div class="editor-field">
            @Html.EditorFor(model => model.AltFirstName)
            @Html.ValidationMessageFor(model => model.AltFirstName)
        </div>
</td>
    </tr>
    
    <tr>
	<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.AltMiddleName)
        </div>
</td>
<td>

        <div class="editor-field">
            @Html.EditorFor(model => model.AltMiddleName)
            @Html.ValidationMessageFor(model => model.AltMiddleName)
        </div>
</td>
<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.AltLastName)
        </div>
</td>
<td>

        <div class="editor-field">
            @Html.EditorFor(model => model.AltLastName)
            @Html.ValidationMessageFor(model => model.AltLastName)
        </div>
</td>
    </tr>
    <tr>
	<td>
        <div class="editor-label">
            @Html.LabelFor(model => model.DateOfBirth)
        </div>
</td>
<td>

        <div class="editor-field">
            @Html.EditorFor(model => model.DateOfBirth)
            @Html.ValidationMessageFor(model => model.DateOfBirth)
        </div>
</td>
<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.Barcode)
        </div>
</td>
<td>

        <div class="editor-field">
            @Html.EditorFor(model => model.Barcode)
            @Html.ValidationMessageFor(model => model.Barcode)
        </div>
</td>
    </tr><tr>
	<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.Sex)
        </div>
</td>
<td>

        <div class="editor-field">
               @Html.DropDownListFor(model => model.SexID, ((IEnumerable<ShivamEMR.Model.Domain.PersonDomain.Sex>)ViewBag.PossibleSexes).Select(option => new SelectListItem
          {
              Text = Html.DisplayTextFor(_ => option.SexName).ToString(),
              Value = option.ID.ToString(),
              Selected = (Model != null) && (option.ID == Model.SexID)
          }), "Choose...")
    @Html.ValidationMessageFor(model => model.SexID)
        </div>
</td>
<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.MaritalStatus)
        </div>
</td>
<td>

        <div class="editor-field">
               @Html.DropDownListFor(model => model.MaritalSatusID, ((IEnumerable<ShivamEMR.Model.Domain.PersonDomain.MaritalStatus>)ViewBag.PassibleMaritalStatus).Select(option => new SelectListItem
          {
              Text = Html.DisplayTextFor(_ => option.Status).ToString(),
              Value = option.ID.ToString(),
              Selected = (Model != null) && (option.ID == Model.MaritalSatusID)
          }), "Choose...")
    @Html.ValidationMessageFor(model => model.MaritalSatusID)
        </div>
</td>
    </tr>
    
   @* <tr>
	<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.PictureID)
        </div>
</td>
<td>

        <div class="editor-field">
            @Html.EditorFor(model => model.PictureID)
            @Html.ValidationMessageFor(model => model.PictureID)
        </div>
</td>
<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.PersonAccountID)
        </div>
</td>
<td>

        <div class="editor-field">
            @Html.EditorFor(model => model.PersonAccountID)
            @Html.ValidationMessageFor(model => model.PersonAccountID)
        </div>
</td>
    </tr>*@
    
    
    <tr>
	     </tr>

     <tr>
   <td>

        <div class="editor-label">
            @Html.LabelFor(model => model.PersonStatus)
        </div>
</td>
<td>

      <div class="editor-field">
    @Html.DropDownListFor(model => model.PersonStatusID, ((IEnumerable<ShivamEMR.Model.Domain.PersonDomain.PersonStatus>)ViewBag.PossiblePersonStatus).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option.Status).ToString(), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.PersonStatusID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.PersonStatusID)
</div>
</td>
    </tr> 
         
         </table>
       </div>
     <div class='pivot-item'>
        <h3>Employee Details</h3> 
     
      <table width="100%" cellpadding="4" cellspacing="4">
		<tr>
<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.EmpCode)
        </div>
</td>
<td>

        <div class="editor-field">
            @Html.EditorFor(model => model.EmpCode)
            @Html.ValidationMessageFor(model => model.EmpCode)
        </div>
</td>
<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.DateOfJoin)
        </div>
</td>
<td>

        <div class="editor-field">
            @Html.EditorFor(model => model.DateOfJoin)
            @Html.ValidationMessageFor(model => model.DateOfJoin)
        </div>
</td>
    </tr>
    <tr>
	<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.EmpNotes)
        </div>
</td>
<td>

        <div class="editor-field">
            @Html.EditorFor(model => model.EmpNotes)
            @Html.ValidationMessageFor(model => model.EmpNotes)
        </div>
</td>
<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.EmployeeStatus)
        </div>
</td>
<td>

      <div class="editor-field">
    @Html.DropDownListFor(model => model.EmployeeStatusID, ((IEnumerable<ShivamEMR.Model.Domain.CompanyDomain.EmployeeStatus>)ViewBag.PossibleEmployeeStatus).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option.Status).ToString(), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.EmployeeStatusID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.EmployeeStatusID)
</div>
</td>
    </tr>
    <tr>
	<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.Group)
        </div>
</td>
<td>

      <div class="editor-field">
    @Html.DropDownListFor(model => model.EmployeeGroupID, ((IEnumerable<ShivamEMR.Model.Domain.CompanyDomain.EmployeeGroup>)ViewBag.PossibleEmployeeGroups).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option.Group).ToString(), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.EmployeeGroupID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.EmployeeGroupID)
</div>
</td>
    </tr>
    
  
    
 
    <tr>
	     </tr></table>
         
         </div>


      
     
    </div>
    
       <p>
            <input type="submit" value="Create" />
        </p>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
<script>
$(function () {
    $("div.metro-pivot").metroPivot();
});
</script>
